﻿ 
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Wpf.Models
{
    /// <summary>
    /// 分诊信息
    /// </summary>
    public class Tr_PatientVisitInfo : BindableBase
    {
        #region 患者基本

        #region 列表显示序号
        private string _NUM = "";
        /// <summary>
        /// 展示序号
        /// </summary>
        public string NUM
        {
            get => _NUM; set
            {
                _NUM = value;
                RaisePropertyChanged("NUM");
            }
        }
        #endregion

        #region 主键
        private string _PVID = "";
        /// <summary>
        /// 急诊患者唯一id
        /// </summary>
        public string PVID
        {
            get => _PVID; set
            {
                _PVID = value;
                RaisePropertyChanged("PVID");
            }
        }
        #endregion

        #region 就诊号
        private string _VISITID = "";
        /// <summary>
        /// 就诊次
        /// </summary>
        public string VISITID
        {
            get => _VISITID; set
            {
                _VISITID = value;
                RaisePropertyChanged("VISITID");
            }
        }
        #endregion

        #region HIS病人id
        private string _PATIENTID = "";
        /// <summary>
        /// 病历号/HIS病人id
        /// </summary>
        public string PATIENTID
        {
            get => _PATIENTID; set
            {
                _PATIENTID = value;
                RaisePropertyChanged("PATIENTID");
            }
        }
        #endregion

        #region 姓名
        private string _PATIENTNAME = "";
        /// <summary>
        /// 姓名
        /// </summary>
        public string PATIENTNAME
        {
            get => _PATIENTNAME; set
            {
                _PATIENTNAME = value;
                RaisePropertyChanged("PATIENTNAME");
            }
        }
        #endregion

        #region 性别
        private string _SEX = "";
        /// <summary>
        /// 性别
        /// </summary>
        public string SEX
        {
            get => _SEX; set
            {
                _SEX = value;
                RaisePropertyChanged("SEX");
            }
        }
        #endregion

        #region 出生日期
        private DateTime? _BIRTHDATE = null;
        /// <summary>
        /// 出生日期
        /// </summary>
        public DateTime? BIRTHDATE
        {
            get => _BIRTHDATE; set
            {
                _BIRTHDATE = value;
                RaisePropertyChanged("BIRTHDATE");
            }
        }
        #endregion

        #region 地址
        private string _ADDRESS = "";
        /// <summary>
        /// 家庭地址
        /// </summary>
        public string ADDRESS
        {
            get => _ADDRESS; set
            {
                _ADDRESS = value;
                RaisePropertyChanged("ADDRESS");
            }
        }
        #endregion

        #region 五级地址
        private string _PROVINCE;
        /// <summary>
        /// 省编码
        /// </summary>
        public string PROVINCE
        {
            get => _PROVINCE; set
            {
                _PROVINCE = value;
                RaisePropertyChanged("PROVINCE");
            }
        }
        private string _CITY;
        /// <summary>
        /// 市编码
        /// </summary>
        public string CITY
        {
            get => _CITY; set
            {
                _CITY = value;
                RaisePropertyChanged("CITY");
            }
        }
        private string _AREA;
        /// <summary>
        /// 区编码
        /// </summary>
        public string AREA
        {
            get => _AREA; set
            {
                _AREA = value;
                RaisePropertyChanged("AREA");
            }
        }
        private string _STREET;
        /// <summary>
        /// 街道编码
        /// </summary>
        public string STREET
        {
            get => _STREET; set
            {
                _STREET = value;
                RaisePropertyChanged("STREET");
            }
        }
        private string _COMMUNITY;
        /// <summary>
        /// 社区编码
        /// </summary>
        public string COMMUNITY
        {
            get => _COMMUNITY; set
            {
                _COMMUNITY = value;
                RaisePropertyChanged("COMMUNITY");
            }
        }

        private string _ADRESS_DETAIL = "";
        /// <summary>
        /// 五级地址拼接
        /// </summary>
        public string ADRESS_DETAIL
        {
            get => _ADRESS_DETAIL; set
            {
                _ADRESS_DETAIL = value;
                RaisePropertyChanged("ADRESS_DETAIL");
            }
        }
        #endregion

        #region 联系人
        private string _CONTACTPERSON;
        /// <summary>
        /// 联系人
        /// </summary>
        public string CONTACTPERSON
        {
            get => _CONTACTPERSON; set
            {
                _CONTACTPERSON = value;
                RaisePropertyChanged("CONTACTPERSON");
            }
        }
        #endregion

        #region 联系人电话
        private string _CONTACTPHONE;
        /// <summary>
        /// 联系电话
        /// </summary>
        public string CONTACTPHONE
        {
            get => _CONTACTPHONE; set
            {
                _CONTACTPHONE = value;
                RaisePropertyChanged("CONTACTPHONE");
            }
        }
        #endregion

        #region 挂号时间
        private DateTime? _REGISTERDT = null;
        /// <summary>
        /// 挂号时间
        /// </summary>
        public DateTime? REGISTERDT
        {
            get => _REGISTERDT; set
            {
                _REGISTERDT = value;
                RaisePropertyChanged("REGISTERDT");
            }
        }
        #endregion

        #region 状态记录
        /// <summary>
        /// 操作前状态
        /// </summary>
        public int OLDSTATUS { get; set; }
        /// <summary>
        /// 操作后状态
        /// </summary>
        public int STATUS { get; set; }
        /// <summary>
        /// 更新标志
        /// </summary>
        public int UPDATESIGN { get; set; }
        #endregion

        #region 来院方式
        private string _REGISTERFROM;
        /// <summary>
        /// 来院方式
        /// </summary>
        public string REGISTERFROM
        {
            get => _REGISTERFROM; set
            {
                _REGISTERFROM = value;
                RaisePropertyChanged("REGISTERFROM");
            }
        }
        #endregion

        #region 分诊时间
        private DateTime? _VISITDATE;
        /// <summary>
        /// 分诊时间
        /// </summary>
        public DateTime? VISITDATE
        {
            get => _VISITDATE; set
            {
                _VISITDATE = value;
                RaisePropertyChanged("VISITDATE");
            }
        }
        #endregion

        #region 身份类型
        private string _IDENTITY;
        /// <summary>
        /// 身份类型
        /// </summary>
        public string IDENTITY
        {
            get => _IDENTITY; set
            {
                _IDENTITY = value;
                RaisePropertyChanged("IDENTITY");
            }
        }
        #endregion

        #region 付费方式

        private string _CHARGETYPE;
        /// <summary>
        /// 付费方式
        /// </summary>
        public string CHARGETYPE
        {
            get => _CHARGETYPE; set
            {
                _CHARGETYPE = value;
                RaisePropertyChanged("CHARGETYPE");
            }
        }
        #endregion

        #region 挂号编号
        private string _REGISTERNO;
        public string REGISTERNO
        {
            get => _REGISTERNO; set
            {
                _REGISTERNO = value;
                RaisePropertyChanged("REGISTERNO");
            }
        }
        #endregion

        #region 身份证号
        private string _INDENTITYNO;
        /// <summary>
        /// 身份证号
        /// </summary>
        public string INDENTITYNO
        {
            get => _INDENTITYNO; set
            {
                _INDENTITYNO = value;
                RaisePropertyChanged("INDENTITYNO");
            }
        }
        #endregion

        private string _NATION;
        /// <summary>
        /// 民族编码
        /// </summary>
        public string NATION
        {
            get => _NATION; set
            {
                _NATION = value;
                RaisePropertyChanged("NATION");
            }
        }
        private string _COUNTRY;
        /// <summary>
        /// 国籍编码
        /// </summary>
        public string COUNTRY
        {
            get => _COUNTRY; set
            {
                _COUNTRY = value;
                RaisePropertyChanged("COUNTRY");
            }
        }
        /// <summary>
        /// 弃诊
        /// </summary>
        public string OUTDEPTTYPE { get; set; }
        /// <summary>
        /// 患者状态
        /// </summary>
        public string PATIENTSTATUS { get; set; }
        public string PHOTO { get; set; }
        private string _ORGANIZATION;
        /// <summary>
        /// 组织机构
        /// </summary>
        public string ORGANIZATION
        {
            get => _ORGANIZATION; set
            {
                _ORGANIZATION = value;
                RaisePropertyChanged("ORGANIZATION");
            }
        }
        private string _GREENROAD;
        /// <summary>
        /// 绿通类型
        /// </summary>
        public string GREENROAD
        {
            get => _GREENROAD; set
            {
                _GREENROAD = value;
                RaisePropertyChanged("GREENROAD");
            }
        }
        public int? GREENROADSTATE { get; set; }

        #region 是否特殊患者
        private int _SPECIALSIGN = 0;

        public int SPECIALSIGN
        {
            get => _SPECIALSIGN; set
            {
                _SPECIALSIGN = value;
                RaisePropertyChanged("SPECIALSIGN");
            }
        }
        #endregion
        private string _BULKINJURYID;
        /// <summary>
        /// 群伤id
        /// </summary>
        public string BULKINJURYID
        {
            get => _BULKINJURYID; set
            {
                _BULKINJURYID = value;
                RaisePropertyChanged("BULKINJURYID");
            }
        }
        private string _BEDNO;
        /// <summary>
        /// 床号
        /// </summary>
        public string BEDNO
        {
            get => _BEDNO; set
            {
                _BEDNO = value;
                RaisePropertyChanged("BEDNO");
            }
        }

        private DateTime? _HAPPENDATE;
        /// <summary>
        /// 发病时间
        /// </summary>
        public DateTime? HAPPENDATE
        {
            get => _HAPPENDATE; set
            {
                _HAPPENDATE = value;
                RaisePropertyChanged("HAPPENDATE");
            }
        }

        private DateTime? _SKINTESTDATE;
        /// <summary>
        /// 皮试时间
        /// </summary>
        public DateTime? SKINTESTDATE
        {
            get => _SKINTESTDATE; set
            {
                _SKINTESTDATE = value;
                RaisePropertyChanged("SKINTESTDATE");
            }
        }

        private int _ISBACKNUM;
        /// <summary>
        /// 退号标记
        /// </summary>
        public int ISBACKNUM
        {
            get => _ISBACKNUM; set
            {
                _ISBACKNUM = value;
                RaisePropertyChanged("ISBACKNUM");
            }
        }
        private string _IDENTITYTYPETAG;
        /// <summary>
        /// 身份类型
        /// </summary>
        public string IDENTITYTYPETAG
        {
            get => _IDENTITYTYPETAG; set
            {
                _IDENTITYTYPETAG = value;
                RaisePropertyChanged("IDENTITYTYPETAG");
            }
        }

        private string _PREHOSPITALID;
        /// <summary>
        /// 转诊医院编码
        /// </summary>
        public string PREHOSPITALID
        {
            get => _PREHOSPITALID; set
            {
                _PREHOSPITALID = value;
                RaisePropertyChanged("PREHOSPITALID");
            }
        }
        private string _RFID;
        public string RFID
        {
            get => _RFID; set
            {
                _RFID = value;
                RaisePropertyChanged("RFID");
            }
        }

        private string _ADDITIONAL1;
        /// <summary>
        /// 备注
        /// </summary>
        public string ADDITIONAL1
        {
            get => _ADDITIONAL1; set
            {
                _ADDITIONAL1 = value;
                RaisePropertyChanged("ADDITIONAL1");
            }
        }

        private string _ADDITIONAL2;
        public string ADDITIONAL2
        {
            get => _ADDITIONAL2; set
            {
                _ADDITIONAL2 = value;
                RaisePropertyChanged("ADDITIONAL2");
            }
        }

        private string _MAINCHIEF;
        /// <summary>
        /// 主诉
        /// </summary>
        public string MAINCHIEF
        {
            get => _MAINCHIEF; set
            {
                _MAINCHIEF = value;
                RaisePropertyChanged("MAINCHIEF");
            }
        }
        private string _MAINCHIEFCONTENT;
        public string MAINCHIEFCONTENT
        {
            get => _MAINCHIEFCONTENT; set
            {
                _MAINCHIEFCONTENT = value;
                RaisePropertyChanged("MAINCHIEFCONTENT");
            }
        }
        private string _CARDNO;
        /// <summary>
        /// 卡号
        /// </summary>
        public string CARDNO
        {
            get => _CARDNO; set
            {
                _CARDNO = value;
                RaisePropertyChanged("CARDNO");
            }
        }

        private string _AGE;
        /// <summary>
        /// 年龄
        /// </summary>
        public string AGE
        {
            get => _AGE; set
            {
                _AGE = value;
                RaisePropertyChanged("AGE");
            }
        }

        private string _HISCLINICNO;
        /// <summary>
        /// 诊室编号
        /// </summary>
        public string HISCLINICNO
        {
            get => _HISCLINICNO; set
            {
                _HISCLINICNO = value;
                RaisePropertyChanged("HISCLINICNO");
            }
        }

        private string _REGISTERUSERNAME;
        /// <summary>
        /// 挂号医生
        /// </summary>
        public string REGISTERUSERNAME
        {
            get => _REGISTERUSERNAME; set
            {
                _REGISTERUSERNAME = value;
                RaisePropertyChanged("REGISTERUSERNAME");
            }
        }

        private string _REGISTERDEPTNAME;
        /// <summary>
        /// 挂号科室
        /// </summary>
        public string REGISTERDEPTNAME
        {
            get => _REGISTERDEPTNAME; set
            {
                _REGISTERDEPTNAME = value;
                RaisePropertyChanged("REGISTERDEPTNAME");
            }
        }
        public int CARDTYPE { get; set; }
        public string HOSPITALCOMPOUNDCODE { get; set; }

        private string _OCCUPATION;
        /// <summary>
        /// 职业
        /// </summary>
        public string OCCUPATION
        {
            get => _OCCUPATION; set
            {
                _OCCUPATION = value;
                RaisePropertyChanged("OCCUPATION");
            }
        }
        private string _MARRIAGETYPE;
        /// <summary>
        /// 婚姻类型
        /// </summary>
        public string MARRIAGETYPE
        {
            get => _MARRIAGETYPE; set
            {
                _MARRIAGETYPE = value;
                RaisePropertyChanged("MARRIAGETYPE");
            }
        }
        public string WARDAREA { get; set; }

        public string _SPECIALID = "";
        /// <summary>
        /// 特殊患者id
        /// </summary>
        public string SPECIALID
        {
            get => _SPECIALID; set
            {
                _SPECIALID = value;
                RaisePropertyChanged("SPECIALID");
            }
        }

        public string _CRITERIONITEMID;
        /// <summary>
        /// 特殊判定
        /// </summary>
        public string CRITERIONITEMID
        {
            get => _CRITERIONITEMID; set
            {
                _CRITERIONITEMID = value;
                RaisePropertyChanged("CRITERIONITEMID");
            }
        }
        private int _TPRBPSTATE = 1;
        /// <summary>
        /// 接受TPRB 1有 2 无 3 拒绝
        /// </summary>
        public int TPRBPSTATE
        {
            get => _TPRBPSTATE; set
            {
                _TPRBPSTATE = value;
                RaisePropertyChanged("TPRBPSTATE");
            }
        }
        public string _CHANGGEPATIENTIDREASON;
        /// <summary>
        /// 修改基本信息原因
        /// </summary>
        public string CHANGGEPATIENTIDREASON
        {
            get => _CHANGGEPATIENTIDREASON; set
            {
                _CHANGGEPATIENTIDREASON = value;
                RaisePropertyChanged("CHANGGEPATIENTIDREASON");
            }
        }

        private string _NATIVEPLACE = "";
        /// <summary>
        /// 籍贯
        /// </summary>
        public string NATIVEPLACE
        {
            get => _NATIVEPLACE; set
            {
                _NATIVEPLACE = value;
                RaisePropertyChanged("NATIVEPLACE");
            }
        }

        private double? _WEIGHT;
        /// <summary>
        /// 体重(kg)
        /// </summary>
        public double? WEIGHT
        {
            get => _WEIGHT; set
            {
                _WEIGHT = value;
                if (_WEIGHT!=null)
                {
                    _STRWEIGHT = _WEIGHT.ToString();
                    RaisePropertyChanged("STRWEIGHT");
                }
                RaisePropertyChanged("WEIGHT");
            }
        }

        private string _STRWEIGHT;
        /// <summary>
        /// 体重(kg)
        /// </summary>
        public string STRWEIGHT
        {
            get => _STRWEIGHT; set
            {
                _STRWEIGHT = value;
                if (!string.IsNullOrEmpty(_STRWEIGHT))
                {
                    double a = 0;
                    if (double.TryParse(_STRWEIGHT, out a))
                    {
                        _WEIGHT = a;
                        //RaisePropertyChanged("WEIGHT");
                    }
                }
                RaisePropertyChanged("STRWEIGHT");
            }
        }

        private string _SCANTYPE;
        /// <summary>
        /// 扫码类型
        /// </summary>
        public string SCANTYPE
        {
            get => _SCANTYPE; set
            {
                _SCANTYPE = value;
                RaisePropertyChanged("SCANTYPE");
            }
        }

        private string _BARCODE;
        /// <summary>
        /// 条码号
        /// </summary>
        public string BARCODE
        {
            get => _BARCODE; set
            {
                _BARCODE = value;
                RaisePropertyChanged("BARCODE");
            }
        }

        public string _RECEIVEUSERID;
        /// <summary>
        /// 接诊人员id
        /// </summary>
        public string RECEIVEUSERID
        {
            get => _RECEIVEUSERID; set
            {
                _RECEIVEUSERID = value;
                RaisePropertyChanged("RECEIVEUSERID");
            }
        }

        public string _MULTIHURT;
        /// <summary>
        /// 多发伤
        /// </summary>
        public string MULTIHURT
        {
            get => _MULTIHURT; set
            {
                _MULTIHURT = value;
                RaisePropertyChanged("MULTIHURT");
            }
        }

        #endregion

        #region 分诊记录
        /// <summary>
        /// guid主键
        /// </summary>
        public string TID { get; set; }

        /// <summary>
        /// 分诊时间
        /// </summary>
        public DateTime? TRIAGEDT { get; set; }
        /// <summary>
        /// 分诊护士
        /// </summary>
        public string TRIAGEBY { get; set; }
        /// <summary>
        /// 分诊护士编码
        /// </summary>
        public string TRIAGEBYCODE { get; set; }
        /// <summary>
        /// 分诊去向
        /// </summary>
        public string TRIAGETARGET { get; set; }
        /// <summary>
        /// 去向关联科室
        /// </summary>
        public string DEPTCODE { get; set; }
        /// <summary>
        /// 其他去向
        /// </summary>
        public string OTHERTRIAGETARGET { get; set; }
        /// <summary>
        /// 手动等级
        /// </summary>
        public string ACTTRIAGELEVEL { get; set; }
        /// <summary>
        /// 自动分级级别
        /// </summary>
        public string AUTOTRIAGELEVEL { get; set; }

        #region 调整级别理由
        private string _TRIAGEMEMO = "";
        /// <summary>
        /// 修改理由
        /// </summary>
        public string TRIAGEMEMO
        {
            get => _TRIAGEMEMO; set
            {
                _TRIAGEMEMO = value;
                RaisePropertyChanged("TRIAGEMEMO");
            }
        }
        #endregion
        public int HASVITALSIGN { get; set; }
        public int HASSCORERECORD { get; set; }
        public int HASACCORDINGRECORD { get; set; }
        public DateTime? STARTRECORDDT { get; set; }
        public int REGISTERFIRST { get; set; }
        public string CHANGELEVEL { get; set; }
        public string TRIAGETARGETCODE { get; set; }
        public string OTHERTRIAGETARGETCODE { get; set; }

        #endregion

       

        #region 扩展信息
        private string _EXTEND1;
        public string EXTEND1
        {
            get => _EXTEND1; set
            {
                _EXTEND1 = value;
                RaisePropertyChanged("EXTEND1");
            }
        }
        private string _EXTEND2;
        public string EXTEND2
        {
            get => _EXTEND2; set
            {
                _EXTEND2 = value;
                RaisePropertyChanged("EXTEND2");
            }
        }
        private string _EXTEND3;
        public string EXTEND3
        {
            get => _EXTEND3; set
            {
                _EXTEND3 = value;
                RaisePropertyChanged("EXTEND3");
            }
        }
        private string _EXTEND4;
        public string EXTEND4
        {
            get => _EXTEND4; set
            {
                _EXTEND4 = value;
                RaisePropertyChanged("EXTEND4");
            }
        }
        private string _EXTEND5;
        public string EXTEND5
        {
            get => _EXTEND5; set
            {
                _EXTEND5 = value;
                RaisePropertyChanged("EXTEND5");
            }
        }
        private string _EXTEND6;
        public string EXTEND6
        {
            get => _EXTEND6; set
            {
                _EXTEND6 = value;
                RaisePropertyChanged("EXTEND6");
            }
        }
        private string _EXTEND7;
        public string EXTEND7
        {
            get => _EXTEND7; set
            {
                _EXTEND7 = value;
                RaisePropertyChanged("EXTEND7");
            }
        }
        private string _EXTEND8;
        public string EXTEND8
        {
            get => _EXTEND8; set
            {
                _EXTEND8 = value;
                RaisePropertyChanged("EXTEND8");
            }
        }
        private string _EXTEND9;
        public string EXTEND9
        {
            get => _EXTEND9; set
            {
                _EXTEND9 = value;
                RaisePropertyChanged("EXTEND9");
            }
        }
        private string _EXTEND10;
        public string EXTEND10
        {
            get => _EXTEND10; set
            {
                _EXTEND10 = value;
                RaisePropertyChanged("EXTEND10");
            }
        }
        private int isChangeLevel = 0;
        public int ISCHANGELEVEL
        {
            get => isChangeLevel; set
            {
                isChangeLevel = value;
                RaisePropertyChanged("ISCHANGELEVEL");
            }
        }
        //患者列表生命体征展示
        public string VitalsignShow { get; set; }
        public string GREENROADNAME { get; set; }
        public string CHARGETYPENAME { get; set; }
        public string REGFROMNAME { get; set; }
        public string GROUPINJURYNAME { get; set; }

        public string _TRIAGETARGETNAME = "";
        /// <summary>
        /// 分诊去向名字
        /// </summary>
        public string TRIAGETARGETNAME
        {
            get => _TRIAGETARGETNAME; set
            {
                _TRIAGETARGETNAME = value;
                RaisePropertyChanged("TRIAGETARGETNAME");
            }
        }

        public string _DIRECTIONNAME = "";
        /// <summary>
        /// 分诊去向字典名字
        /// </summary>
        public string DIRECTIONNAME
        {
            get => _DIRECTIONNAME; set
            {
                _DIRECTIONNAME = value;
                RaisePropertyChanged("DIRECTIONNAME");
            }
        }
        /// <summary>
        /// 颜色代码
        /// </summary>
        public string COLOUR { get; set; }

        private string _LEVELNAME = "";
        /// <summary>
        /// 分诊等级名
        /// </summary>
        public string LEVELNAME
        {
            get => _LEVELNAME; set
            {
                _LEVELNAME = value;
                RaisePropertyChanged("LEVELNAME");
            }
        }

        /// <summary>
        /// 所属院区
        /// </summary>
        public string HOSPITAL_BRANCH { get; set; }
        #endregion

        #region 分诊提醒扩展字段
        /// <summary>
        /// 最后修改时间
        /// </summary>
        public DateTime? UPDATEDATE { get; set; }
        /// <summary>
        /// 最后修改人
        /// </summary>
        public string UPDATEUSER { get; set; }
        /// <summary>
        /// 超时时间（分钟）
        /// </summary>
        public int INTERVAL { get; set; }
        /// <summary>
        /// 是否超时预警
        /// </summary>
        public int ISWARING { get; set; }

        #endregion

        #region 陪护人

        public string _PHR1NAME = "";
        public string PHR1NAME
        {
            get => _PHR1NAME; set
            {
                _PHR1NAME = value;
                RaisePropertyChanged("PHR1NAME");
            }
        }
        public string _PHR1ID = "";
        public string PHR1ID
        {
            get => _PHR1ID; set
            {
                _PHR1ID = value;
                RaisePropertyChanged("PHR1ID");
            }
        }
        public string _PHR1TEMP = "";
        public string PHR1TEMP
        {
            get => _PHR1TEMP; set
            {
                _PHR1TEMP = value;
                RaisePropertyChanged("PHR1TEMP");
            }
        }

        public string _PHR2NAME = "";
        public string PHR2NAME
        {
            get => _PHR2NAME; set
            {
                _PHR2NAME = value;
                RaisePropertyChanged("PHR2NAME");
            }
        }
        public string _PHR2ID = "";
        public string PHR2ID
        {
            get => _PHR2ID; set
            {
                _PHR2ID = value;
                RaisePropertyChanged("PHR2ID");
            }
        }
        public string _PHR2TEMP = "";
        public string PHR2TEMP
        {
            get => _PHR2TEMP; set
            {
                _PHR2TEMP = value;
                RaisePropertyChanged("PHR2TEMP");
            }
        }
        #endregion

        #region 过敏史

        private int isAllergy = 2;
        /// <summary>
        /// 是否有过敏史  0无 1有 2未查
        /// </summary>
        public int ISALLERGY
        {
            get => isAllergy; set
            {
                isAllergy = value;
                RaisePropertyChanged("ISALLERGY");

            }
        }
        private string _ALLERGYS;
        /// <summary>
        /// 过敏史显示文字
        /// </summary>
        public string ALLERGYS
        {
            get
            {
                return _ALLERGYS;
            }
            set
            {
                _ALLERGYS = value;
                RaisePropertyChanged("ALLERGYS");
            }
        }  

        #endregion

      

        #region 就诊卡信息
        private string _BRKH = "";
        /// <summary>
        /// 病人就诊卡号
        /// </summary>
        public string BRKH
        {
            get => _BRKH; set
            {
                _BRKH = value;
                RaisePropertyChanged("BRKH");
            }
        }

        private double _ZHYE;
        /// <summary>
        /// 账户余额
        /// </summary>
        public double ZHYE
        {
            get => _ZHYE; set
            {
                _ZHYE = value;
                RaisePropertyChanged("ZHYE");
            }
        }


        private string _MZHM = "";
        /// <summary>
        /// 门诊号码
        /// </summary>
        public string MZHM
        {
            get => _MZHM; set
            {
                _MZHM = value;
                RaisePropertyChanged("MZHM");
            }
        }

        #endregion


        #region 院前号码
        private string _YQHM = "";
        /// <summary>
        /// 院前号码YQHM
        /// </summary>
        public string YQHM
        {
            get => _YQHM; set
            {
                _YQHM = value;
                RaisePropertyChanged("YQHM");
            }
        }
        #endregion

        #region 五大中心
        private string _FIVECENTER = "";
        /// <summary>
        /// 五大中心标志（多个逗号间隔）1：医院胸痛中心 2：卒中中心 3：创伤救治中心 4：危重孕产妇救治中心 5：危重新生儿救治中心
        /// </summary>
        public string FIVECENTER
        {
            get => _FIVECENTER; set
            {
                _FIVECENTER = value;
                RaisePropertyChanged("FIVECENTER");
            }
        }
        #endregion
        public string STR_VISITDATE
        {
            get { return VISITDATE.GetValueOrDefault().ToString("yyyy-MM-dd HH:mm:ss"); }
            set
            {
                if (!string.IsNullOrEmpty(value))
                {
                    DateTime temp = new DateTime();
                    if (!DateTime.TryParse(value, out temp))
                    {
                        string temp2 = "";
                        if (value.Length == 14)
                        {
                            temp2 = value.Substring(0, 4) + "-" + value.Substring(4, 2) + "-" + value.Substring(6, 2) + " " + value.Substring(8, 2) + ":" + value.Substring(10, 2);
                        }
                        else
                        {
                            temp2 = value.Substring(0, 4) + "-" + value.Substring(4, 2) + "-" + value.Substring(6, 2);
                        }
                        temp = Convert.ToDateTime(temp2);
                    }
                    VISITDATE = temp;
                }
            }
        }

        public string STR_BIRTHDATE
        {
            get
            {
                if (BIRTHDATE == null)
                    return string.Empty;
                else
                    return BIRTHDATE.GetValueOrDefault().ToString("yyyy-MM-dd HH:mm:ss");
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                {
                    DateTime temp = new DateTime();
                    if (!DateTime.TryParse(value, out temp))
                    {
                        string temp2 = "";
                        if (value.Length == 14)
                        {
                            temp2 = value.Substring(0, 4) + "-" + value.Substring(4, 2) + "-" + value.Substring(6, 2) + " " + value.Substring(8, 2) + ":" + value.Substring(10, 2);
                        }
                        else
                        {
                            temp2 = value.Substring(0, 4) + "-" + value.Substring(4, 2) + "-" + value.Substring(6, 2);
                        }
                        temp = Convert.ToDateTime(temp2);
                    }
                    BIRTHDATE = temp;
                }
            }
        }
        #region 接口工具方法名
        public string InterfaceToolName { get; set; }
        #endregion


        private string _IC_NO;
        /// <summary>
        /// 社保手册号
        /// </summary>
        public string IC_NO
        {
            get => _IC_NO; set
            {
                _IC_NO = value;
                RaisePropertyChanged("IC_NO");
            }
        }
    }
}
